import { createStore } from 'vuex'
import User from './modules/user'
const store =  createStore({
  state: {
  },
  getters: {
  },
  mutations: {},
  actions: {
  },
  modules: {
    user: User
  }
})

store.subscribe((mutataions, state: any) => {
  localStorage.setItem('userInfo', JSON.stringify(state.user.userInfo));
  localStorage.setItem('token', JSON.stringify(state.user.token));
})

export default store
